package com.sky.orangehireserver.modules.enterprise.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import jakarta.validation.constraints.*;
import java.math.BigDecimal;

/**
 * 岗位更新请求DTO
 * 
 * @author sky
 */
@Data
@Schema(description = "岗位更新请求DTO")
public class JobUpdateDTO {

    /**
     * 职位ID
     */
    @NotNull(message = "职位ID不能为空")
    @Schema(description = "职位ID", example = "1")
    private Long id;

    /**
     * 职位名称
     */
    @Size(max = 100, message = "职位名称长度不能超过100个字符")
    @Schema(description = "职位名称", example = "Java高级开发工程师")
    private String title;

    /**
     * 所属部门
     */
    @Size(max = 50, message = "部门名称长度不能超过50个字符")
    @Schema(description = "所属部门", example = "技术部")
    private String department;

    /**
     * 工作地点/城市
     */
    @Size(max = 100, message = "工作地点长度不能超过100个字符")
    @Schema(description = "工作地点/城市", example = "北京")
    private String location;

    /**
     * 工作类型
     */
    @Pattern(regexp = "^(full_time|part_time|intern|contract)$", message = "工作类型格式不正确")
    @Schema(description = "工作类型", example = "full_time", allowableValues = {"full_time", "part_time", "intern", "contract"})
    private String employmentType;

    /**
     * 经验要求
     */
    @Pattern(regexp = "^(junior|mid|senior)$", message = "经验要求格式不正确")
    @Schema(description = "经验要求", example = "mid", allowableValues = {"junior", "mid", "senior"})
    private String seniority;

    /**
     * 学历要求
     */
    @Pattern(regexp = "^(bachelor|master|phd|none)$", message = "学历要求格式不正确")
    @Schema(description = "学历要求", example = "bachelor", allowableValues = {"bachelor", "master", "phd", "none"})
    private String education;

    /**
     * 最低薪资
     */
    @DecimalMin(value = "0", message = "最低薪资不能小于0")
    @Schema(description = "最低薪资", example = "10000")
    private BigDecimal salaryMin;

    /**
     * 最高薪资
     */
    @DecimalMin(value = "0", message = "最高薪资不能小于0")
    @Schema(description = "最高薪资", example = "20000")
    private BigDecimal salaryMax;

    /**
     * 货币类型
     */
    @Pattern(regexp = "^(CNY|USD|EUR)$", message = "货币类型格式不正确")
    @Schema(description = "货币类型", example = "CNY", allowableValues = {"CNY", "USD", "EUR"})
    private String currency;

    /**
     * 职位状态
     */
    @Pattern(regexp = "^(draft|open|closed)$", message = "职位状态格式不正确")
    @Schema(description = "职位状态", example = "open", allowableValues = {"draft", "open", "closed"})
    private String status;

    /**
     * 职位描述
     */
    @Size(max = 2000, message = "职位描述长度不能超过2000个字符")
    @Schema(description = "职位描述")
    private String description;

    /**
     * 任职要求/技能要求
     */
    @Size(max = 2000, message = "任职要求长度不能超过2000个字符")
    @Schema(description = "任职要求/技能要求")
    private String requirements;

    /**
     * 岗位职责
     */
    @Size(max = 2000, message = "岗位职责长度不能超过2000个字符")
    @Schema(description = "岗位职责")
    private String responsibilities;

    /**
     * 福利待遇
     */
    @Size(max = 1000, message = "福利待遇长度不能超过1000个字符")
    @Schema(description = "福利待遇")
    private String benefits;

    /**
     * 职位标签/关键词，用逗号分隔
     */
    @Size(max = 200, message = "职位标签长度不能超过200个字符")
    @Schema(description = "职位标签/关键词，用逗号分隔", example = "Java,Spring,MySQL")
    private String tags;
}